# -*- coding: utf-8 -*-
"""
Created on Fri Aug 09 11:22:41 2013

@author: Jeanhwea
"""

import smtplib
from email.message import Message
 
text = """Hello,
This is a test message. I hope you enjoy it!
-- Anonymous"""

msg = Message()
msg['To'] = 'jeanhwea@126.com'
msg['From'] = 'pythonsll@126.com'
msg['Subject'] = 'Test Message, Chapter 12'
msg.set_payload(text)

smtp = smtplib.SMTP('smtp.126.com')

code = smtp.ehlo()

smtp.login('pythonsll@126.com','password')

f = 'pythonsll@126.com'
t = 'jeanhwea@126.com'

smtp.sendmail(f, t, msg)

smtp.quit()